<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>v-model和select结合使用</title>
    <script src="../lib/vue_v2.6.14.js"></script>
  </head>
  <body>
    <div id="app">
      <select v-model="fruitVal">
        <option value="" disabled>--请选择--</option>
        <option v-for="(item, index) in fruitList" :key="item.id" :value="item.value">{{ item.value }}</option>
      </select>
      <h3>你选中了：{{ fruitVal }}</h3>
    </div>

    <script>
      const vm = new Vue({
        el: '#app',
        data: {
          fruitList: [
            { id: 1, value: '苹果' },
            { id: 2, value: '香蕉' },
            { id: 3, value: '葡萄' },
            { id: 4, value: '火龙果' }
          ],
          fruitVal: ''
        }
      })
    </script>
  </body>
</html>
